feat(packaging): publish omp-deck as a global npm CLI#3
Merged
Conversation
Adds the wiring to ship omp-deck as a globally-installable npm package
that exposes an `omp-deck` command.
Approach: ship raw TS server source + pre-built web/dist + bundled
`@omp-deck/protocol` and let Bun execute the server. A small Node-runnable
shim is the `bin` entry: it checks for Bun on PATH (with an actionable
install message if missing), sets sensible env defaults (data dir
`~/.omp-deck/`, web dist next to the bundled assets, starter dirs from
the package), then `spawn('bun', [serverEntry])` with stdio + signals +
exit code forwarded.
Workspace-dep plumbing:
- `bundledDependencies: ['@omp-deck/protocol']` so npm picks up the
workspace package
- `scripts/prepack.mjs` materializes the symlinked `packages/protocol`
into `node_modules/@omp-deck/protocol/` as a real directory, strips
`private` + `dependencies` from the bundled package.json (otherwise
npm thinks the bundled deps are already satisfied and never installs
ajv/ajv-formats at the parent)
- `scripts/postpack.mjs` runs `bun install` to restore the workspace
symlinks so the dev workflow keeps working after a local `npm pack`
Lifts the server's runtime deps + ajv/ajv-formats to the root
package.json so npm installs them globally.
Verified end-to-end:
- `npm pack` produces a 3.3 MB tarball (10.5 MB unpacked); `bundled deps:
1` confirmed via `tar -tzf`
- `npm install -g --prefix <tmp>` installs 267 packages and produces
`omp-deck.cmd` / `omp-deck.ps1` / `omp-deck` shims
- Running the shim boots the server, creates `~/.omp-deck/deck.db` (with
migrations + welcome seed), starter-skills + starter-extensions install
from the bundled paths, web assets served, API responds 200
- Repo workspace symlinks restored after pack; typecheck across all 4
packages still clean
Audit of the v0.5.0 tarball turned up files that sit under `files`- allowlisted paths but should never ship publicly: - `apps/server/src/templates/paper-trading-*.yaml` — operator-private routine templates (already gitignored). Hardcoded `C:\Users\bryan\...` paths and personal trading workflow. No API secrets, but explicitly marked 'never lands in the public repo' in .gitignore. - `apps/server/**/*.test.ts` — bloat with no runtime value (~50 files). - `apps/web/dist/**/*.map` — the JS source map alone was 6.9 MB. `.npmignore` cannot subtract from a `files` allowlist (documented npm behavior), so the fix is physical: prepack moves these files into `.publish-stash/` with a manifest, npm packs the tree without them, postpack moves them back. Result: tarball drops from 3.3 MB / 214 files → 1.6 MB / 185 files. Re-verified: clean install + boot end-to-end, all five paper-trading templates restored to the workspace, all bridge tests restored, `node_modules/@omp-deck/protocol` symlink restored.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Wires omp-deck to ship as a globally-installable npm package. After this lands, install + run is:
```sh
npm install -g omp-deck
omp-deck
```
(Requires Bun ≥ 1.3.14 — the deck is Bun-native. The shim prints an actionable install message if Bun is missing.)
How
Ships raw TS server source + pre-built `apps/web/dist/` + the bundled `@omp-deck/protocol` workspace package. A small Node-runnable shim is the `bin` entry — Node is used so a missing-Bun install can print install instructions instead of `ENOENT`. The shim sets sensible env defaults (data dir `~/.omp-deck/`, `OMP_DECK_WEB_DIST`, `OMP_DECK_STARTER_*_DIR`), then `spawn('bun', [serverEntry])` with stdio + signals + exit code forwarded.
Workspace-dep plumbing was the only real friction:
Lifted the server's runtime deps + `ajv` + `ajv-formats` to the root `package.json` so they get installed alongside.
Files
Verified end-to-end
What is NOT in this PR
Release / publish playbook (for whoever ships this)